
import java.util.*;
public class text68 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            String s=in.nextLine();
            String s1="";
            String s2="";
            int i=0;
            for(i=0;i<s.length();i++)
            {
                char ch=s.charAt(i);
                if(ch>='0'&&ch<='9')
                {
                    s1=s1+ch+"";

                }
                else
                {
                    if(s1.length()>s2.length())
                    {
                        s2=s1;
                    }
                    else
                    {
                        s1="";

                    }
                }

            }
            if(i==s.length()&&s1.length()>s2.length())
            {
                //System.out.println(s1);
                s2=s1;

            }


            System.out.println(s2);




        }
    }




}
